Skip to content

chore(release): prepare v0.9.0 - #263

Merged
gouyt13 merged 76 commits into
mainfrom
release/v0.9.0
Nov 23, 2026
Merged

gouyt13 merged 76 commits into
mainfrom
release/v0.9.0

Conversation

@gouyt13

@gouyt13 gouyt13 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Release 0.9.0, a breaking release. It merges dev/0.9 into main and bumps the version. The release notes list every change:

txtai 9.15.0. As promised in #213, this waited for the first txtai release with neuml/txtai#1616. That is txtai 9.15.0, released on PyPI on 2026-11-23; the txtai check below ran against its tag.

Merge with a merge commit. The frozen fixtures in tests/fixtures/persistence/v0.9.0/README.md name 9c7c4a5 as their source, and the v0.9.0 tag contains that commit only if this PR is merged with a merge commit.

Changes in this branch

  • 9c7c4a5, the version bump:
    • Version 0.9.0 in pyproject.toml and CMakeLists.txt.
    • Install pins, clone commands and version text updated in the README, home page, installation, quick start and C++ integration pages.
    • unreleased.md becomes docs/docs/releases/0.9.0.md, with a title, a summary and an Upgrading section, under a new 0.9 group in the navigation. The migration guide's three links follow.
    • README news gains v0.9.0 and keeps three entries.
    • The Python samples still run on 0.8.5, so their README keeps that pin.
  • 0c38beb, frozen format-2 fixtures in tests/fixtures/persistence/v0.9.0. docs/formats.md requires a frozen fixture for every released format change.
    • Eleven indexes written by 9c7c4a5 through IvfIndex, HnswIndex and SymqgIndex, and through ivf::IVF and symqg::QuantizedGraph for the matrix rotator.
    • Together they cover every section kind 0.9 writes, and each metric, including cosine, for every index type.
    • Seed 42, one thread; two runs of the generator give identical bytes.
    • The IVF-RaBitQ and HNSW-RaBitQ files remove points 0 and 32. Point 32 is the third query's nearest neighbour, so ignoring removal markers changes their reference results.
    • The C++ and Python tests load each file through the supported classes and check the recorded settings and search results.
  • f6ff6d5, txtai:
    • docs/docs/integrations/txtai.md describes the adapter at neuml/txtai@86f3bad.
    • The txtai entry of the notes says txtai 9.14.0 users should keep rabitqlib<0.9.
    • tests/python/test_txtai_compat.py makes the merged adapter's calls, including a search with unfilled result slots.
  • 04941c7, fixes from a check of the user documentation. That check ran all 20 Python and 44 C++/CMake examples on 0.9.0, read every page against the code, and checked 141 external links.
    • Two stale sentences about older releases reading new files are removed.
    • usage.md explains the capacity rename.
    • The installation page links the 0.9 migration guide.
    • Four moved links are updated.
    • Example variables are described, and two examples no longer replace the Quick Start's index that later examples use.
  • a4d266f, the README license badge. It now links the LICENSE file on GitHub, because the relative link broke on the PyPI page. A 0.9.0 wheel built with this README passes twine check --strict.
  • 4ae1cc5, the txtai version. docs/docs/integrations/txtai.md and the release notes name txtai 9.15.0 as the first release that works with 0.9.

Apart from the version, this branch changes no library source relative to dev/0.9 (97eb05e).

Checks

At f6ff6d5 (04941c7, a4d266f and 4ae1cc5 change documentation only; mkdocs build --strict passes on them), on Linux x86-64 (Xeon Gold 6418H), GCC 14.3.0, native optimization off:

Downstream compatibility

Candidate: this branch at f6ff6d5; the later commits change documentation only. Platform: Linux x86-64, Python 3.13, GCC 14.3.0. Thresholds were fixed before running.

txtai

Revisions. txtai v9.15.0 (d223ef7), the first release with neuml/txtai#1616 (86f3bad). Its src/python/txtai/ann/dense/rabitq.py is unchanged since 86f3bad and identical to the file in the txtai-9.15.0 wheel on PyPI, and its ann extra requires rabitqlib>=0.8.5. Candidate: the 0.9.0 package built and installed from f6ff6d5. Previous supported version: rabitqlib 0.8.5 from PyPI.

Commands. From an export of the txtai v9.15.0 tag:

cd test/python
PYTHONPATH=<txtai>/src/python python -W always::DeprecationWarning -m unittest testann.testdense.testrabitq
PYTHONPATH=<txtai>/src/python python check.py

For 0.8.5, the unpacked wheel comes first on PYTHONPATH. check.py goes through txtai's ANNFactory with 5000 unit vectors in 128 dimensions (a mixture of 32 Gaussians, seed 0) and 100 queries, with exact inner-product top-10 as ground truth.

Thresholds.

  • recall@10 at least 0.80 for ivf and hnsw at 4 bits, and 0.95 for ivf at 32 bits;
  • recall within 0.02 of 0.8.5 in each mode;
  • IDs in range and unique, and scores non-increasing;
  • identical IDs and scores after save/load;
  • ivf: appended vectors are their own top-1 with the next IDs, and deleted IDs stay absent after save/load;
  • hnsw: append and delete raise NotImplementedError, as the adapter documents.

Results.

Check 0.9.0 candidate 0.8.5
txtai testrabitq 6 passed, 0 deprecation warnings 6 passed, 0 deprecation warnings
ivf, nbits 4: recall@10 0.925 0.922
ivf, nbits 32: recall@10 0.997 0.997
hnsw, nbits 4: recall@10 0.925 0.925
IDs, score order, save/load, ivf append and delete, hnsw modification pass pass

An earlier run of the same checks against txtai master at 351a2ba, which has the same rabitq.py, gave 0.922, 0.998 and 0.925 for the candidate and 0.917, 0.997 and 0.925 for 0.8.5, and passed everything else. The data and queries are the same in both runs, so the differences of up to 0.005 most likely come from building with the default number of threads, as the adapter does.

txtai 9.14.0, the release before, uses the call forms 0.9 removes. Its own RaBitQ tests, run the same way from an export of the v9.14.0 tag, fail on the candidate (4 errors, each a TypeError from the index constructor) and pass on 0.8.5 (4 passed, with deprecation warnings).

Not tested. txtai's full suite (its CI ran it for #1616 on Linux, macOS and Windows with rabitqlib 0.8.5), other platforms with the candidate, and embeddings-level workflows beyond the ann backend.

zvec

Revisions. zvec main at 8d978b0, which pins RaBitQ-Library v0.7.0 (de793e8). Candidate: an export of f6ff6d5. Baseline: v0.7.0, zvec's pin.

Build. zvec builds RaBitQ-Library through thirdparty/RaBitQ-Library/CMakeLists.txt, with core and FastScan only (RABITQ_BUILD_INDEX=OFF, RABITQ_USE_OPENMP=OFF, native optimization off); GCC 14.3.0, CMake, Ninja, Release.

Changes to zvec for the check.

  • RABITQ_SOURCE_DIR in thirdparty/RaBitQ-Library/CMakeLists.txt points at an export of the candidate, or of v0.7.0 for the baseline.
  • For the candidate only, tests/core/algorithm/ivf_rabitq/ivf_rabitq_streamer_test.cc:633 calls g_kbxsumq() instead of kbxsumq(), the accessor rename from 0.8.0 (refactor!: rename query factor accessors with the g_ prefix #201).

No other change was needed. All four RaBitQ test translation units compiled against the candidate headers. src/turbo/CMakeLists.txt:239 still adds the submodule's RaBitQ-Library-0.7.0/include, but only for the vendored Eigen behind its OPQ rotator. The RaBitQ tests do not depend on turbo.

Commands.

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_C_BINDINGS=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_CPP_EXAMPLES=OFF
cmake --build build --parallel 8 --target hnsw_rabitq_index_test hnsw_rabitq_streamer_test ivf_rabitq_streamer_test rabitq_dispatch_test
OMP_NUM_THREADS=4 <test binary>

Results. Both builds compile without warnings. Candidate and baseline pass the same 38 tests:

Test Candidate v0.7.0
hnsw_rabitq_index_test 4 passed 4 passed
hnsw_rabitq_streamer_test (build and search, KNN and linear search, iterator, open/close, dimensions, ex-bits mismatch) 9 passed 9 passed
ivf_rabitq_streamer_test (build and search; close and reopen for L2, inner product, cosine and 1-bit; recall; filters; primary-key search; parameter and format validation) 24 passed 24 passed
rabitq_dispatch_test 1 passed 1 passed

For zvec's eventual bump. Two changes are needed: the kbxsumq() to g_kbxsumq() rename above, and the hard-coded RaBitQ-Library-0.7.0/include path in src/turbo/CMakeLists.txt:239.

Not tested. The full zvec build (DB layer, Arrow, RocksDB, turbo, Python and C bindings), other platforms, zvec's Python tests, and a numerical comparison between candidate and baseline beyond each test's thresholds.

Add a draft specification of the shared index container planned for
0.9 (#212): header, section table, feature flags, record layouts,
companion files, reading order and compatibility rules. Nothing in it
is implemented yet.
Add the container layer of index file format 2 (#212): the header and
section table encoding, a zlib-compatible CRC-32, a writer that emits
the file front to back without seeking, and a reader that validates
the header, feature flags, expected index kind and section table in
the order the specification gives. No index uses it yet.

Update the draft specification with the rules the implementation
settled: empty sections, the check order, padded_dim at most 65,536,
reserved section kind 0, and what a resave drops.
IVF-RaBitQ save writes index format 2 (#212): one file whose sections
hold the rotator blob, the routing parameters and data, the codes,
the rerank data and the IDs. HNSW centroid routing becomes a section,
so save no longer writes a <file>.hnsw sidecar. Load dispatches on the
magic and keeps reading every earlier layout, including their
sidecars.

- ivf::Initializer replaces save/load on file streams with
  write(std::ostream&) and read(std::istream&, bytes).
- The vendored hnswlib gains stream overloads of saveIndex and
  loadIndex; the path overloads delegate to them.
- The rotator blob codec and a zlib-compatible CRC-32 move to private
  core sources for C++ readers and writers.
- The format-2 reader reads each bulk section front to back, and the
  HNSW graph check tracks a byte budget instead of querying positions.
- Freeze IVF files written by v0.8.3 (RABQIDX1 v2, Flat RaBitQ and HNSW
  routing with sidecars) as release-produced fixtures.
- Document the IVF sections, the HNSW graph layout and the IVF reader
  rules in the specification, and note the changes for users.
The HNSW load benchmark still called the removed Initializer save and
load; write and read the graph file through the stream interface, with
the file open inside the timing as before.

The legacy-sidecar test named its directory with a narrow literal, which
MSVC encodes in the code page; use a UTF-8 literal.
The first-add test compares saved files, which now include the HNSW
routing graph. Training the explicit index with several threads built
that graph in a nondeterministic order, so the files differed on CI;
train it with one thread, like the implicit first add. Document that
the routing graph is reproducible only when built with one thread.
Before HNSW-RaBitQ and SymphonyQG move to index format 2, freeze files
their v0.8.3 writers produce: HNSW at 1, 5 and 9 bits with removals and
upper layers, and SymphonyQG raw, 4- and 8-bit with FHT/Kac and matrix
rotation. A separate generator writes them, so the committed IVF
fixtures keep their bytes.
HNSW-RaBitQ (sections 512-516) and SymphonyQG (sections 768-770) now
save index format 2, like IVF-RaBitQ. Loading dispatches on the magic
and keeps reading their earlier layouts; HNSW-RaBitQ shares its graph
checks between both readers.

- Every index records its construction seed, and SymphonyQG also its
  ef_construction and initialization, so Python keeps them after load.
  New C++ accessors report them: IVF::seed(), HierarchicalNSW::seed(),
  QuantizedGraph<float>::seed(), ef_construction() and
  initialization(). QGInitialization moves to qg.hpp.
- Unknown read-only-compatible features make every index read-only:
  HNSW-RaBitQ refuses add, resize, remove and save; SymphonyQG refuses
  save until a builder rebuilds it.
- A failed HNSW-RaBitQ write reports "HNSW index file cannot be
  written".
- Tests that patched freshly saved files at old offsets now damage
  format-2 fields, and the earlier layouts' checks run on copies of the
  v0.8.3 fixtures.
- Document the HNSW-RaBitQ and SymphonyQG reader rules and the seed of
  each index in the specification, and format the fixture generator.
MSVC requires a lambda to capture a local constexpr variable it reads,
which GCC and Clang do not.
Every index load throws rabitqlib::FormatError, a std::runtime_error in the
new public header rabitqlib/index/format_error.hpp, for a truncated,
corrupt, mismatched or unsupported file in format 2 and every earlier
layout. Failing to open a file stays a plain std::runtime_error.

Python raises it as rabitqlib.FormatError, a subclass of both ValueError
and RuntimeError, so existing except RuntimeError handlers keep working.
rabitqlib.quant.FormatError becomes the same class; it was a ValueError
only.

An earlier-layout IVF file with an invalid metric byte and an
earlier-layout SymphonyQG file with invalid settings threw
std::invalid_argument; both now throw FormatError. This resolves the
spec's open question on the Python error type.
Closes the Python half of #211. search returns int64 IDs, and slots
without a neighbor hold -1 instead of 2**32 - 1, with distance inf as
before. add returns int64 IDs; remove already took any integer IDs and
still rejects -1 and other out-of-range values.

C++ point IDs stay 32-bit PID values with kPidMax for a missing result.
The bindings search into a PID buffer and widen it once per batch to
int64, mapping kPidMax to -1. That adds one pass and a temporary buffer
of num_queries * k IDs per search call; this change makes no performance
claim.

txtai 9.14.0 and earlier filter with uid != 0xFFFFFFFF; the release notes
point to #213 for the first compatible txtai release.
An independent review found loads that still escaped the FormatError
contract:

- A format-2 SymphonyQG file whose point count and degree bound fit
  their limits but whose records exceed size_t threw std::length_error.
  Earlier SymphonyQG layouts with huge stored dimensions did the same.
- Earlier IVF-RaBitQ and SymphonyQG layouts with a dimension the stored
  FHT/Kac rotation does not support threw std::invalid_argument from the
  rotator.
- The earlier IVF-RaBitQ reader relied on the stream exception mask and
  caught std::ios_base::failure. libstdc++ before GCC 13 throws the old
  ABI type from its iostreams, which that catch does not match. The
  reader now checks each group of reads, which also undoes the
  reindentation of the previous commit.

Each case has a C++ test that fails without this change and a Python
boundary test. The docs say that a failed read after opening raises
FormatError, the release notes list every converted exception, the IVF
parameter table names -1, and the txtai compatibility test notes that its
filter no longer matches a missing result.
IVF-RaBitQ, HNSW-RaBitQ and SymphonyQG accept METRIC_COSINE (Python
metric="cosine"). An index stores METRIC_IP internally and normalizes
vectors where they enter: train, construct, add, search and the
SymphonyQG builder. The normalization sums squares in double and
scales each coordinate once, and a zero vector stays zero. The
inner-product distance 1 - dot of unit vectors is 1 - cos, so a cosine
index stores exactly what an inner-product index of the normalized
vectors stores, apart from the metric field of format 2, which readers
now accept.

MetricType gains METRIC_COSINE. The stable core API v1, factor
computation, query classes, FastScan, clustering and the IVF
initializers keep rejecting it with their existing messages, so v1
stays 1.0. rabitqlib.quant still rejects "cosine".

Coordinates are checked before normalizing. Training data that fails
the check is reported by the index instead of k-means. Centroids given
to set_centroids or construct are used as given.

Tests compare each index with an inner-product index of the normalized
vectors: section bytes, IDs and distances, before and after reload.
They also cover zero vectors, failed and replacing loads, training
errors, earlier layouts rejecting metric byte 2, and v1 rejecting the
new value.
dev/0.9 collects the breaking changes of the 0.9 release while main keeps
shipping 0.8.x. The Python workflow only ran for pull requests whose base
is main or master, so pull requests into dev/0.9 skipped the Python
checks; the C++ and documentation workflows already run for any base.
dev/0.9 is main at ecc594c plus the workflow change that runs the Python
checks for pull requests into dev/0.9.

Conflicts:
- docs/docs/index/usage.md: both sides reworded the note on nondeterministic
  HNSW builds; keep the wording from main.
- tests/python/test_ivf.py: keep this branch's save-failure and
  embedded-routing tests, building their indexes with the _built helper
  that main introduced instead of the 0.7 constructor and build.
feat(index): add index format 2 for every index
main is at v0.8.5 (cf2764f): the 0.9 names with deprecation warnings for
the 0.8 spellings (#235, #236) and the 0.8.5 release preparation (#237).

Conflicts, resolved by keeping both sides:
- docs/docs/index/{hnsw,ivf,qg}.md: the cosine metric and the -1
  missing-result ID from dev/0.9, the new names from main.
- python_bindings/__init__.py: the FormatError import from dev/0.9 in
  main's import layout.
- python_bindings/__init__.pyi: cosine in the metric lists, routing for
  initializer.
- tests/python/typing/public_api.py: routing= with the cosine metric type.

Changes git could not make, because the two sides did not touch the same
lines:
- The deprecated search overloads from main return int64 IDs, as every
  search does on dev/0.9; a typing fixture checks it.
- The migration guide said three changes come without a warning in 0.9;
  with int64 IDs, the -1 marker and format 2 that count was wrong.
chore: merge main (v0.8.5) into dev/0.9
…parameters

QGKMeans configures the same SymphonyQG graph as the index under other
names (#233). In C++:

- QGKMeansParameters: graph_degree becomes max_degree, ef_build becomes
  ef_construction, and quantization_bits (0, 4 or 8) becomes nbits (32, 4
  or 8, with 32 for raw float32). The fields keep their order and types.
  QGAssigner keeps its constructor, including quantization_bits with 0
  for raw storage; the parameters are converted for it.
- The messages follow the names: "QGKMeans nbits must be 4, 8, or 32",
  "QGKMeans max_degree must be a positive multiple of 32", "QGKMeans
  requires more centroids than max_degree" and "QGKMeans ef_construction
  and ef_search must be positive".
- FinalAssignmentMode::SymphonyQG, an alias of Approximate, is removed.
- qgkmeans::QGKMeansIterationStats and
  rabitqkmeans::RaBitQKMeansIterationStats are removed; use
  clustering::KMeansIterationStats.

The C++ tests, the qgkmeans sample and the installed consumer use the new
names. The Python bindings still name the old fields and build again with
the next commit, which renames them.
…natively

0.8 kept the 0.7 call forms, and 0.8.5 the 0.8 spellings, in a Python
layer that replaced members of the extension classes and raised
DeprecationWarning. 0.9 deletes that layer and gives the extension the
0.9 API itself (#213, #232, #233):

- Removed 0.7 forms: the point-count constructors and random_seed=,
  SymqgIndex(dim, max_degree, metric, quantization_bits), build(),
  is_built, SymqgIndex.search_batch() and quantization_bits, add options
  by position, and the private hooks behind them (_build, _max_elements,
  _quantization_bits).
- Index names: IvfIndex(routing=...) and routing for initializer,
  IvfIndex.reserve_cluster for reserve, HnswIndex.capacity and
  reserve(num_points) for max_elements and resize, ef_search for ef.
  max_elements is gone from IvfIndex and SymqgIndex. reserve only grows
  the capacity, and within the capacity it only reads, so it may run
  alongside searches.
- search: only nprobe or ef_search stays positional; high_accuracy and
  num_threads are keyword-only. nprobe=0 and ef_search=0 raise
  ValueError; None selects the default.
- HnswIndex draws a 32-bit seed when none is given, as the other two
  classes do, instead of using 100, and rejects seeds above 2**32 - 1.
- k-means: QGKMeansParameters has nbits, max_degree and ef_construction;
  final_assignment is 'approximate' or 'exact', also on index.cp, and
  reads back as that string; KMeansIterationStats is the only name of
  the statistics class. FinalAssignmentMode and the two old statistics
  names leave the package.

A removed form raises a plain TypeError, AttributeError or ValueError and
is never read as another call: IvfIndex(dim, 1000, 64) is an error, not an
index with 1000 clusters.

The index classes are now the extension's own, so a wrong argument raises
pybind11's TypeError with the supported signature, and inspect.signature()
no longer works on them. An invalid k-means nbits is reported by train,
like the other parameters. repr() prints capacity= and routing=.

The stubs lose their 37 deprecated declarations. The migration guide, the
unreleased notes, the index and clustering pages and the naming contract
in docs/development.md describe the 0.9 forms, including the C++ renames
of the previous commit. Reproducible HNSW builds now need seed= as well as
num_threads=1, and the pages that gave the recipe say so.
…ed ones fail

Much of the Python suite still used the 0.8 spellings and passed only
through the deleted compatibility layer, with deprecation warnings.

- Every test file uses the 0.9 names. Tests that built two HnswIndex
  objects without a seed and compared them, or asserted something that
  depends on the graph, now pass a seed.
- test_compat_08.py and test_compat_09.py are replaced by
  test_removed_forms.py: each 0.7 form and 0.8 spelling raises TypeError,
  AttributeError or ValueError, the private hooks are gone, and the
  renamed members behave as documented.
- test_txtai_compat.py follows the calls a 0.9-compatible txtai backend
  makes (set_centroids and add(cluster_ids=...), np.isfinite for missing
  results, None for an unset ef); they also run without warnings on 0.8.5.
- The typing fixture rejects the removed forms under mypy and Pyright
  instead of accepting them as deprecated.
- Behaviour that only the deleted files covered keeps a test: reserve
  within the capacity during a search, the drawn HNSW seed, SymqgIndex
  construction settings and a failed add, the k-means graph-parameter
  messages, negative search options, and pickling KMeansIterationStats.
- HnswIndex.reserve cannot shrink, so the shrinking leg of the
  allocation-threshold test moves to a C++ test of
  HierarchicalNSW::resize.
… graphs

HnswIndex draws a seed when none is given, so one thread alone no longer
reproduces a graph. The num_threads entry of the add docstring still gave
the 0.8 recipe; the class docstring and the documentation pages already
name the seed.
feat(python)!: remove the 0.7 and 0.8 forms and expose the 0.9 names natively
The workflow of the Python IvfIndex was implemented in the binding, so a
C++ caller had to rebuild it on ivf::IVF. IvfIndex implements it in C++,
as step 1 of #234:

- IvfIndex(dim, num_clusters, IvfOptions), a static load, and train,
  set_centroids, add, remove, reserve_cluster, search and save with the
  names, defaults and state errors of the Python class.
- The first add trains an untrained index on a staged copy, so a failure
  leaves it untrained and empty.
- IDs are rabitqlib::Id (int64_t), kNoId marks a missing result, and
  search takes a batch, pads with kNoId and +inf, and probes
  num_clusters / 16 clusters, rounded and at least 1, by default.
- A seed is drawn unless given; cp() holds the clustering defaults.

The header forward-declares ivf::IVF and the k-means parameters, so it
pulls in no implementation header; a separate consumer boundary checks
that. ivf::IVF is unchanged. An allocation-failure sweep covers the
rollback of the first add after training has succeeded.
The binding drops the staged first-add training, the default nprobe, the
result padding and the state checks, which rabitqlib::IvfIndex now
implements. It keeps the NumPy conversions, shape checks, the checks
whose messages name Python values, the GIL release and the IndexAccess
guards.

cp stays binding state and is copied into the native index with the GIL
and the write guard held before train and add release the GIL, because
Python writes its fields without a guard.

Results, messages and the Python suite are unchanged. A call with both
an invalid argument and the wrong state may now report the argument
first, for example ValueError for nprobe=0 on an untrained index.
feat(index): add rabitqlib::IvfIndex and build the Python binding on it
Since #222 the Python IvfIndex.add returns an int64 array, as the HNSW page
and the release notes say; one sentence in the IVF page still said uint32.
The index classes and rabitqlib.quant accepted "innerproduct" as a second
spelling of "ip"; index.metric and quant.Query.metric always report "ip".
For 0.9, which spells each concept one way (#232), the shared metric
parser drops the alias, so metric="innerproduct" raises ValueError with
the existing messages. 0.8.5 accepted it without a warning, so the release
notes and the migration guide list it with the changes that come without
one.

The stubs, docstrings, quick start and the clustering sample CLI drop the
alias too. Tests that used it now pass "ip"; a new test checks that the
three index classes and quant.Query, query_terms and code_factors reject
it, and the typing fixture checks that mypy and Pyright reject it.
feat(python)!: accept only "ip" as the inner-product metric name
pickle.dumps(obj, protocol=0) or protocol=1 on any rabitqlib object
aborted the process. Those protocols reduce through copyreg._reduce_ex,
which calls pybind11_object(obj); its constructor throws a C++ exception
through the C API, so the interpreter terminates (pybind11 issue 3745,
reproduced with pybind11 3.1.0 and master).

Every extension class and enum now defines __reduce_ex__, which uses the
protocol-2 reduction for protocols 0 and 1. quant.Rotator, quant.Query and
the enums pickle with every protocol; the other classes raise TypeError,
as they already did with protocol 2 and higher. Protocols 2 to 5 produce
the same bytes as before.

A child-process test covers protocols 0 and 1 on every class, and a static
test checks that each extension class defines __reduce_ex__.
build(cmake): accept only the same minor version in the package config
0.9 is the first release that writes index format 2, and its reader binds
every later file, so the specification must state what the reader
enforces. The layout rule now says what reader and writer do: each section
starts at or after the end of the previous table entry, so an empty section
shares its offset only with entries after it; the earlier text also allowed
an empty section inside or at the start of the previous one, which the
reader rejects. Also: drop the draft status and close the open question
(the header is not a blob); header growth is per release within version 2;
readers check the checksum of known sections exactly when checksummed is
set and read known kinds whatever their required bit; reading step 5 lists
the checks in the reader's order; the replaced IVF layouts include RBFQRAW1
and the unversioned one; stale proposal wording is removed. A test pins the
layout rule for empty sections.
Readers do not validate writer_version, but two FormatError messages embed
it. A byte outside printable ASCII reached Python's error conversion, which
decodes messages as UTF-8, so loading such a file raised UnicodeDecodeError
instead of rabitqlib.FormatError. The messages now show those bytes, and
backslashes, as \xNN; Reader::writer_version() still returns the stored
bytes. The specification says readers do not validate the field.
fix(format2): freeze the format-2 specification and escape the stored writer version
The C++ API of releases before 0.8 could save an HNSW-RaBitQ index before
training it. 0.9 loads such a file untrained, with num_clusters 16, but the
file records no seed, so the first add cannot train it. add, search, remove
and save then said "HnswIndex must be trained or loaded before add", which
is wrong for a loaded index. They now say to call train or set_centroids.

A release-produced fixture from v0.7.2 (tests/fixtures/persistence/v0.7.2)
covers the path, which no test exercised: C++ and Python tests load it,
check the messages, and train it with train or set_centroids before add
and a save/load round trip.
fix(hnsw): explain how to train an index loaded from an untrained file
0.9 added METRIC_COSINE for the ANN indexes, which normalize vectors; the
quantizers, FastScan and clustering are documented to reject it.
QGAssigner passed its metric unchecked to QuantizedGraph<float>, which
accepts cosine, so it assigned by cosine but reported exact distances on a
2(1 - cos) scale instead of rejecting the metric. Its constructor now calls
validate_metric_type after the configuration checks. QGKMeans passes only
L2 or inner product and is unaffected.
fix(clustering): reject the cosine metric in QGAssigner
An HNSW-RaBitQ file saved before training loads untrained. Comments,
docstrings, the stub, hnsw.md and the release notes named 0.7 or 0.8 for it
inconsistently, and some said "trained or loaded" where such a loaded index
is not trained. They now say "a file saved before training" or "an index
loaded from an untrained file", and HnswIndex.load and search say what they
return and require. The release notes also say "all three" samples, give the
RuntimeError type, and move the CMake find_package bullet to the end of the
C++ section, so the migration table follows the new-class bullets again.
The release categories had no place for breaking changes, so breaking PRs
appeared under Added. A manual release:breaking label now maps to a first
category, Breaking changes; the title classifier does not manage it, so it
stays on the PR alongside the automatic category.
docs: describe untrained HNSW files without a release number
The Householder Q factor that MatrixRotator stored has a fixed determinant
and a negative first entry, so it is not Haar distributed. Give column i of
Q the sign of R(i, i) (Mezzadri 2007, Section 5). A given seed now yields a
different matrix; saved rotators and indexes are unaffected.
fix(rotator): make MatrixRotator Haar distributed
Cosine indexes scale data and queries to unit length, but set_centroids
and construct used the given centroids as they were. The codes are
residuals against the centroids, so centroids far from the unit sphere,
such as the means of unscaled data, ruined the estimates: with centroids
of norm about 100, recall@10 fell to 0.001 at 5 bits.

ivf::IVF and hnsw::HierarchicalNSW now scale centroids given to
set_centroids or construct, after checking their coordinates, as they
scale data. train keeps the centroids k-means computes from the scaled
data, so trained indexes are unchanged. IvfIndex, HnswIndex and the
Python classes get the fix through set_centroids.

Closes #259.
fix(index): scale given centroids of cosine indexes to unit length
distance_ratio and horizontal_avg in the installed header
rabitqlib/utils/tools.hpp had undefined behavior. distance_ratio formed
data + id * dim for every result ID, so a missing result (kNoId or
kPidMax, which the index searches use for padding) read out of bounds.
horizontal_avg read data[0] on empty input, read past shorter rows, and
divided signed sums by a size_t, so horizontal_avg<int> of three rows of
-1 gave 1431655764.

Neither is index functionality: distance_ratio has no callers, and
horizontal_avg's only callers are the C++ querying samples. Remove both,
and the <cmath>, <queue> and <vector> includes only they used. The
samples average their measurements with querying_example::column_averages
in sample/cpp/querying_example.hpp. The release notes record the removal.
fix(utils)!: remove the evaluation helpers from tools.hpp
Bump the version to 0.9.0 in pyproject.toml and CMakeLists.txt, and update
the install pins, clone commands and version text in the README, home
page, installation, quick start and C++ integration pages.

Turn docs/docs/releases/unreleased.md into docs/docs/releases/0.9.0.md:
give it a title and summary, add the Upgrading section, list it under a
0.9 group in the navigation and point the migration guide's links at it.
The txtai entry names 9.14.0 as the first txtai release with a RaBitQ
backend instead of "9.14.0 and earlier".

README news gains v0.9.0 and keeps the three most recent entries. The
Python samples still run on 0.8.5, so their README keeps that pin.
formats.md requires a frozen fixture for every released format change. Add
tests/fixtures/persistence/v0.9.0: eleven indexes written by the release
source through IvfIndex, HnswIndex and SymqgIndex, and through ivf::IVF and
symqg::QuantizedGraph for the matrix rotator. Together they use every
section kind 0.9 writes and each metric, including cosine, for every index
type, and record seed 42. They reuse the 130-point, 65-dimension data of
the v0.8.3 set and are seeded and built with one thread, so the generator
reproduces them byte for byte on the recorded producer.

The IVF-RaBitQ and HNSW-RaBitQ files remove point 0, the only point of its
cluster, and point 32, the nearest neighbour of the third query, so the
reference results show whether removal markers are honoured. The cosine
indexes get unit-length centroids, as their data is scaled (#259).

The C++ and Python tests load each file through the supported classes,
check the recorded metric, bits, seed, counts, routing and construction
settings, compare search results with the reference, and save and reload
it without a sidecar.
txtai merged neuml/txtai#1616 (86f3bad), which moves its rabitq backend
to forms that rabitqlib 0.8.5 and 0.9 accept. Point the txtai page at
that revision: it declares rabitqlib>=0.8.5, builds with set_centroids
and add(cluster_ids=...), and drops unfilled slots by their infinite
distance. Note that the first build adds with every available CPU, that
0.9 files need 0.9, that txtai's RaBitQ tests pass on 0.8.5 and on a 0.9
build, and that txtai 9.14.0 users should keep rabitqlib<0.9.

test_txtai_compat.py now makes the merged adapter's calls: positional
dimensions and cluster counts, and math.isfinite on each distance. An
IVF search with a long result list checks that unfilled slots are
dropped.

TXTAI_RELEASE in the txtai page and the 0.9.0 notes stands for the first
txtai release that contains the change, still to be filled in.
@github-actions github-actions Bot added the release:maintenance Release category managed from the PR title label Nov 22, 2026
- hnsw.md and qg.md: drop the sentences about older releases failing only on
  padded dimensions that are not a multiple of 64; releases up to 0.8 cannot
  read any file 0.9 saves, as the pages already say.
- usage.md: num_points and num_stored_points date from 0.7.0, and capacity is
  0.7.0's max_elements, renamed in Python 0.8.5 and C++ 0.9.
- installation.md: point 0.8 users to the migration guide and the 0.9.0
  release notes.
- ivf.md, hnsw.md, clustering.md: say what dim, num_clusters, sample, vectors,
  x and queries are, and name the routing and training examples' indexes so
  the update examples keep using the Quick Start's index.
- README.md and qg.md: update the moved VectorChord, NGT, LanceDB and
  ClickHouse links.
README.md is also the PyPI page, where the relative LICENSE link resolves
to a missing page. Use the absolute GitHub URL; twine check --strict passes
on a 0.9.0 wheel built with it.
@gouyt13
gouyt13 marked this pull request as ready for review November 23, 2026 11:34
@gouyt13
gouyt13 merged commit 9734b8d into main Nov 23, 2026
73 of 75 checks passed
@gouyt13
gouyt13 deleted the release/v0.9.0 branch November 23, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:maintenance Release category managed from the PR title

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant